// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

const int N = 105, MOD = 998244353;

int k, n;

LL a[N];

inline int bitcount(LL x) {
    int cnt = 0;
    while (x) {
        x &= (x-1);
        ++cnt;
    }
    return cnt;
}

int main(int argc, char const *argv[]) {
    // code
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> k;
    for (int i=0; i<n; ++i)
        cin >> a[i];
    LL cur = 1LL << k, now = 0, ans = 0, mask = cur-1;
    for (int i=0; i<n; ++i) {
        now |= a[i];
        LL nextcur = 1LL << bitcount((~now) & mask);
        // dbg(now, nextcur, cur);
        ans = (ans + (cur - nextcur) % MOD * (i + 1)) % MOD;
        cur = nextcur;
    }
    cout << ans << endl;
    return 0;
}
